package com.feng.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String hello(Model model){
        model.addAttribute("msg","hello springmvc annotation");
        return "hello";
//        转发和重定向的运用
//        return "forword:/hello.jsp";
//        return "redirect:/hello.jsp";
    }
}
